﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Principal;
using System.Web;
using Disco.Ontology;

namespace Disco.Web.Api
{
    public class UserIdentity : IIdentity
    {
        public User User { get; private set; }

        public UserIdentity(User user, string requestedName = "")
        {
            User = user;
            RequestedName = requestedName;
        }

        public string AuthenticationType
        {
            get { return "Basic"; }
        }

        public bool IsAuthenticated
        {
            get { return true; }
        }

        public string Name
        {
            get { return User != null ? User.Alias : null; }
        }

        public string RequestedName
        {
            get;
            private set;
        }
    }
}